home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / gfx / xfig_doc.lha / doc / FORMAT2.1 < prev    next >
Text File  |  1995-08-22  |  10KB  |  342 lines

  1. NOTE: THIS FILE FORMAT IS OBSOLETE.  THIS DOCUMENT IS ONLY PROVIDED
  2.     FOR BACKWARD COMPATIBILITY AND INFORMATION.
  3.  
  4. (1) The very first line is a comment line containing the name and version:
  5.     #FIG 2.1
  6.  
  7.     The character # at the first column of a line indicates that the line
  8.     is a comment line which will be ignored.
  9.  
  10. (2) The first non-comment line consists of two numbers :
  11.  
  12.     int    fig_resolution        (pixels/inch)
  13.     int    coordinate_system    (1 : origin is the lower left corner (NOT USED)
  14.                      2 : Upper left)
  15.  
  16.     Fig_resolution is the resolution fig is using for the current file.
  17.     It must always be 80 for compatibility with this version of Fig.
  18.     Pixels are assumed to be square.
  19.  
  20.     Xfig only uses the upper-left coordinate system (2).
  21.  
  22. (3) The rest of the file contains various objects.  An object can be one
  23.     of six classes (or types).
  24.  
  25.       i)    Arc.
  26.      ii)    Ellipse which is a generalization of circle.
  27.     iii)    Polyline which includes polygon and box.
  28.      iv)    Spline which includes closed/open control/interpolated spline.
  29.       v)    Text.
  30.      vi)    Compound object which is composed of one or more objects.
  31.  
  32.     In the following elaboration on object formats, every value of fig
  33.     output are separated by blank characters or new line ('\n').  The
  34.     value of the not-used parameters will be -1.
  35.  
  36.     Some fields are described as "enumeration type" or "bit vector"; the 
  37.     values which these fields can take are defined in the header file object.h.
  38.     The pen, arrow_type, and arrow_style fields are described as unused.
  39.     These values may be defined in some future version of Fig.
  40.  
  41.     The color field is defined as follows:
  42.  
  43.     -1 = Default
  44.      0 = Black
  45.      1 = Blue
  46.      2 = Green
  47.      3 = Cyan
  48.      4 = Red
  49.      5 = Magenta
  50.      6 = Yellow
  51.      7 = White
  52.      values from 8 to 2^30-1 = reserved for future use
  53.  
  54.     The depth field is defined as follows:
  55.  
  56.      0 ... 999 where larger value means object is deeper than (under)
  57.            objects with smaller depth
  58.  
  59.     The area fill field is defined as follows:
  60.     
  61.      0 = not filled
  62.      1 = white
  63.     ...  values from 2 to 20 are shades of grey, from lighter to darker
  64.     21 = black
  65.  
  66.     The line_style field is defined as follows:
  67.  
  68.     -1 = Default
  69.      0 = Solid
  70.      1 = Dashed
  71.      2 = Dotted
  72.  
  73.     The style_val field is defined as the length, in pixels, of the on/off dashes
  74.     for dashed lines, and the distance between the dots, in pixels, for dotted lines
  75.  
  76.     (3.1) ARC
  77.  
  78.     First line :
  79.     type    name            (brief description)
  80.     ----    ----            -------------------
  81.     int    object_code        (always 5)
  82.     int    sub_type        (always    1)
  83.     int    line_style        (enumeration type)
  84.     int    line_thickness        (pixels)
  85.     int    color            (enumeration type)
  86.     int    depth            (enumeration type)
  87.     int    pen            (not used)
  88.     int    area_fill        (enumeration type)
  89.     float    style_val        (pixels)
  90.     int    direction        (0 : clockwise, 1 : counterclockwise)
  91.     int    forward_arrow        (0: no forward arrow, 1: on)
  92.     int    backward_arrow        (0: no forward arrow, 1: on)
  93.     float    center_x, center_y    (center of the arc)
  94.     int    x1, y1            (pixels, the 1st point the user entered)
  95.     int    x2, y2            (pixels, the 2nd point)
  96.     int    x3, y3            (pixels, the last point)
  97.  
  98.     Forward arrow line (Optional; absent if forward_arrow is 0) :
  99.     type    name            (brief description)
  100.     ----    ----            -------------------
  101.     int    arrow_type        (not used)
  102.     int    arrow_style        (not used)
  103.     float    arrow_thickness        (pixels)
  104.     float     arrow_width        (pixels)
  105.     float    arrow_height        (pixels)
  106.  
  107.     Backward arrow line (Optional; absent if backward_arrow is 0) :
  108.     type    name            (brief description)
  109.     ----    ----            -------------------
  110.     int    arrow_type        (not used)
  111.     int    arrow_style        (not used)
  112.     float    arrow_thickness        (pixels)
  113.     float    arrow_width        (pixels)
  114.     float    arrow_height        (pixels)
  115.  
  116.     (3.2) COMPOUND
  117.  
  118.     A line with object code 6 signifies the start of a compound.
  119.     There are four more numbers on this line which indicate the
  120.     upper right corner and the lower left corner of the bounding
  121.     box of this compound.  A line with object code -6 signifies
  122.     the end of the compound.  Compound may be nested.
  123.  
  124.     First line :
  125.     type    name            (brief description)
  126.     ----    ----            -------------------
  127.     int    object_code        (always 6)
  128.     int    upperright_corner_x    (pixels)
  129.     int    upperright_corner_y    (pixels)
  130.     int    lowerleft_corner_x    (pixels)
  131.     int    lowerleft_corner_y    (pixels)
  132.  
  133.     Subsequent lines :
  134.     objects
  135.     .
  136.     .
  137.  
  138.     Last line :
  139.     -6
  140.  
  141.     (3.3) ELLIPSE
  142.  
  143.     First line :
  144.     type    name            (brief description)
  145.     ----    ----            -------------------
  146.     int    object_code        (always 1)
  147.     int    sub_type        (1 : ellipse defined by radiuses
  148.                      2 : ellipse defined by diameters
  149.                      3 : circle defined by radius
  150.                      4 : circle defined by diameter)
  151.     int    line_style        (enumeration type)
  152.     int    thickness        (pixels)
  153.     int    color            (enumeration type)
  154.     int    depth            (enumeration type)
  155.     int    pen            (not used)
  156.     int    area_fill        (enumeration type)
  157.     float    style_val        (pixels)
  158.     int    direction        (always 1)
  159.     float    angle            (radians, the angle of the x-axis)
  160.     int    center_x, center_y    (pixels)
  161.     int    radius_x, radius_y    (pixels)
  162.     int    start_x, start_y    (pixels; the 1st point entered)
  163.     int    end_x, end_y        (pixels; the last point entered)
  164.  
  165.     (3.4) POLYLINE
  166.  
  167.     First line :
  168.     type    name            (brief description)
  169.     ----    ----            -------------------
  170.     int    object_code        (always 2)
  171.     int    sub_type        (1 : polyline
  172.                      2 : box
  173.                      3 : polygon
  174.                      4 : arc-box)
  175.                      5 : imported-eps bounding-box)
  176.     int    line_style        (enumeration type)
  177.     int    thickness        (pixels)
  178.     int    color            (enumeration type)
  179.     int    depth            (enumeration type)
  180.     int    pen            (not used)
  181.     int    area_fill        (enumeration type)
  182.     float    style_val        (pixels)
  183.     int    radius            (pixels, radius of arc-boxes)
  184.     int    forward_arrow        (0: off, 1: on)
  185.     int    backward_arrow        (0: off, 1: on)
  186.  
  187.     Forward arrow line : same as ARC object
  188.  
  189.     Backward arrow line : same as ARC object
  190.  
  191.     EPS line :
  192.     type    name            (brief description)
  193.     ----    ----            -------------------
  194.     boolean    flipped            orientation = normal (0) or flipped (1)
  195.     char    file[]            name of eps file to import
  196.  
  197.     Points line :
  198.     type    name            (brief description)
  199.     ----    ----            -------------------
  200.     int    x1, y1            (pixels)
  201.     int    x2, y2            (pixels)
  202.       .
  203.       .
  204.     int    xn, yn            (this will be the same as the 1st
  205.                     point for polygon and box)
  206.     int    x, y            (always 9999, 9999; marks the end of
  207.                     point for polygon and box)
  208.  
  209.     (3.5) SPLINE
  210.  
  211.     First line :
  212.     type    name            (brief description)
  213.     ----    ----            -------------------
  214.     int    object_code        (always 3)
  215.     int    sub_type        (0 : open spline
  216.                      1 : closed spline
  217.                      2 : open interpolated spline
  218.                      3 : closed interpolated spline)
  219.     int    line_style        (See the end of this section)
  220.     int    thickness        (pixels)
  221.     int    color            (enumeration type)
  222.     int    depth            (enumeration type)
  223.     int    pen            (not used)
  224.     int    area_fill        (enumeration type)
  225.     float    style_val        (pixels)
  226.     int    forward_arrow        (0: off, 1: on)
  227.     int    backward_arrow        (0: off, 1: on)
  228.  
  229.     Forward arrow line : same as ARC object
  230.  
  231.     Backward arrow line : same as ARC object
  232.  
  233.     Points line : same as POLYLINE object
  234.  
  235.     Control points line (absent if sub_type is 0 or 1) :
  236.     Control points of interpolated spline.  There are two control
  237.     points for each knots.  A section i, of the spline is drawn
  238.     using Bezier cubic with the following four points:
  239.         (x ,y ), (rx ,ry ), (lx      , ly   ), (x   , y   ).
  240.           i  i        i    i      i+1    i+1     i+1   i+1
  241.     For closed interpolated spline the last pair of control points,
  242.     (lxn,lyn) and (rxn,ryn) (which can be ignored), are the same as
  243.     (lx1,ly1) and (rx1,ry1) respectively.
  244.  
  245.     type    name            (brief description)
  246.     ----    ----            -------------------
  247.     float    lx1, ly1        (pixels)
  248.     float    rx1, ry1        (pixels)
  249.     float    lx2, ly2        (pixels)
  250.     float    rx2, ry2        (pixels)
  251.       .
  252.       .
  253.     float    lxn, lyn        (pixels)
  254.     float    rxn, ryn        (pixels)
  255.  
  256.     (3.6) TEXT
  257.     type    name            (brief description)
  258.     ----    ----            -------------------
  259.     int    object             (always 4)
  260.     int    sub_type        (0 : Left justified
  261.                      1 : Center justified
  262.                      2 : Right justified)
  263.     int    font             (enumeration type)
  264.     int    font_size         (font size in points)
  265.     int    pen            (not used)
  266.     int    color            (enumeration type)
  267.     int    depth            (enumeration type)
  268.     float    angle            (radians, the angle of the text)
  269.     int    font_flags        (bit vector)
  270.     int    height            (pixels)
  271.     int    length            (pixels)
  272.     int    x, y            (pixels, coordinate of the origin
  273.                      of the string.  If sub_type = 0, it is
  274.                      the lower left corner of the string.
  275.                      If sub_type = 1, it is the lower
  276.                      center.  Otherwise it is the lower
  277.                      right corner of the string.)
  278.     char    string[]        (ascii characters; starts after a blank
  279.                      character following the last number and
  280.                      ends before the character '\1' (control-A).
  281.                      This character is not part of the string.
  282.                      Note that the string may contain '\n'.)
  283.  
  284.     The font_flags field is defined as follows:
  285.  
  286.      Bit    Description
  287.  
  288.       0    Rigid text (text doesn't scale when scaling compound objects)
  289.       1    Special text (for LaTeX)
  290.       2    PostScript font (otherwise LaTeX font is used)
  291.       3    Hidden text
  292.  
  293.     The font field is defined as follows:
  294.  
  295.     For font_flags bit 2 = 0 (LaTeX fonts):
  296.  
  297.      0    Default font
  298.      1    Roman
  299.      2    Bold
  300.      3    Italic
  301.      4    Modern
  302.      5    Typewriter
  303.  
  304.     For font_flags bit 3 = 1 (PostScript fonts):
  305.  
  306.     -1    Default font
  307.      0    Times Roman
  308.      1    Times Italic
  309.      2    Times Bold
  310.      3    Times Bold Italic
  311.      4    AvantGarde Book
  312.      5    AvantGarde Book Oblique
  313.      6    AvantGarde Demi
  314.      7    AvantGarde Demi Oblique
  315.      8    Bookman Light
  316.      9    Bookman Light Italic
  317.     10    Bookman Demi
  318.     11    Bookman Demi Italic
  319.     12    Courier
  320.     13    Courier Oblique
  321.     14    Courier Bold
  322.     15    Courier Bold Oblique
  323.     16    Helvetica
  324.     17    Helvetica Oblique
  325.     18    Helvetica Bold
  326.     19    Helvetica Bold Oblique
  327.     20    Helvetica Narrow
  328.     21    Helvetica Narrow Oblique
  329.     22    Helvetica Narrow Bold
  330.     23    Helvetica Narrow Bold Oblique
  331.     24    New Century Schoolbook Roman
  332.     25    New Century Schoolbook Italic
  333.     26    New Century Schoolbook Bold
  334.     27    New Century Schoolbook Bold Italic
  335.     28    Palatino Roman
  336.     29    Palatino Italic
  337.     30    Palatino Bold
  338.     31    Palatino Bold Italic
  339.     32    Symbol
  340.     33    Zapf Chancery Medium Italic
  341.     34    Zapf Dingbats
  342.